print *, maxval(A, mask = B < 5)